Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised docs deployments #947

Merged

Conversation

yunchu
Copy link
Contributor

@yunchu yunchu commented Apr 18, 2023

Summary

Revised documentation deployments. There are two different workflows.

  1. A workflow to generate documentations from the latest development branch (triggered on push event to develop)
  2. A workflow to generate documentations from the latest release (triggered on publish the a release)

The gh-pages environment for this repo will serve the documentations from latest release as default. (https://openvinotoolkit.github.io/datumaro/)
but the documentations generated by the latest develop or previous releases could be used by using the different URL like below:

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added the description of my changes into CHANGELOG.​
  • I have updated the documentation accordingly

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT

@yunchu yunchu force-pushed the infra/hotfix-target-env-name-for-docs_stable-wf branch from 25967d6 to d7a8fc1 Compare April 18, 2023 04:01
@yunchu yunchu changed the base branch from develop to releases/1.2.0 April 18, 2023 04:02
@yunchu yunchu marked this pull request as ready for review April 18, 2023 04:03
@yunchu yunchu requested review from a team as code owners April 18, 2023 04:03
mkdir -p /tmp/docs_build
cp -r docs/build/html/* /tmp/docs_build/
rm -rf ${{ env.RELEASE_VERSION }}/*
echo '<html><head><meta http-equiv="refresh" content="0; url=stable/" /></head></html>' > index.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url=stable, is it correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. gh-pages can only serve single set of static pages so the redirecting to the 'stable' should be the default docs to this repo.

Comment on lines +31 to +70
echo SOURCE_NAME=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
echo SOURCE_BRANCH=${GITHUB_REF#refs/heads/} >> $GITHUB_OUTPUT
echo SOURCE_TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
existed_in_remote=$(git ls-remote --heads origin gh-pages)

if [[ -z ${existed_in_remote} ]]; then
echo "Creating gh-pages branch"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout --orphan gh-pages
git reset --hard
touch .nojekyll
git add .nojekyll
git commit -m "Initializing gh-pages branch"
git push origin gh-pages
git checkout ${{steps.branch_name.outputs.SOURCE_NAME}}
echo "Created gh-pages branch"
else
echo "Branch gh-pages already exists"
fi
- name: Commit docs to gh-pages branch
run: |
git fetch
git checkout gh-pages
mkdir -p /tmp/docs_build
cp -r docs/build/html/* /tmp/docs_build/
rm -rf ${{ env.RELEASE_VERSION }}/*
echo '<html><head><meta http-equiv="refresh" content="0; url=stable/" /></head></html>' > index.html
mkdir -p ${{ env.RELEASE_VERSION }}
cp -r /tmp/docs_build/* ./${{ env.RELEASE_VERSION }}
ln -sfn ${{ env.RELEASE_VERSION }} stable
rm -rf /tmp/docs_build
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add ./index.html ./stable ${{ env.RELEASE_VERSION }}
git commit -m "Update documentation" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend you to wrap up the common part. For example,

uses: ./.github/workflows/notify_teams.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good idea but I don't have enough idea at this moment because the commit steps need to update different links - stable and latest. I will try to apply such idea later.

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Patch coverage: 83.15% and project coverage change: +0.06 🎉

Comparison is base (ed3cf05) 78.64% compared to head (d7a8fc1) 78.70%.

Additional details and impacted files
@@                Coverage Diff                 @@
##           releases/1.2.0     #947      +/-   ##
==================================================
+ Coverage           78.64%   78.70%   +0.06%     
==================================================
  Files                 228      232       +4     
  Lines               26342    26420      +78     
  Branches             5249     5258       +9     
==================================================
+ Hits                20717    20795      +78     
+ Misses               4406     4400       -6     
- Partials             1219     1225       +6     
Flag Coverage Δ
macos-11_Python-3.8 77.73% <83.15%> (+0.06%) ⬆️
ubuntu-20.04_Python-3.8 78.69% <83.15%> (+0.06%) ⬆️
windows-2019_Python-3.8 78.59% <83.15%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
datumaro/cli/util/project.py 33.67% <ø> (ø)
datumaro/components/progress_reporting.py 61.53% <ø> (ø)
...ugins/data_formats/common_semantic_segmentation.py 82.02% <ø> (ø)
datumaro/plugins/data_formats/imagenet.py 91.76% <ø> (ø)
datumaro/plugins/sampler/random_sampler.py 79.62% <ø> (ø)
datumaro/cli/commands/merge.py 21.17% <20.00%> (+0.97%) ⬆️
datumaro/components/environment.py 87.12% <55.00%> (-3.74%) ⬇️
datumaro/components/merge/base.py 74.19% <58.82%> (-19.75%) ⬇️
datumaro/components/visualizer.py 88.97% <74.54%> (-2.32%) ⬇️
datumaro/components/hl_ops/__init__.py 67.08% <75.00%> (-2.15%) ⬇️
... and 13 more

... and 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@vinnamkim vinnamkim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@yunchu yunchu merged commit 5980200 into releases/1.2.0 Apr 18, 2023
@yunchu yunchu deleted the infra/hotfix-target-env-name-for-docs_stable-wf branch April 18, 2023 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants